﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OliveChess
{
    class Bench
    {
        public static void BenchSetFenPerfs()
        {
            /*
            Stopwatch wa = new Stopwatch();
            Stopwatch wb = new Stopwatch();
            int nbPieces = 0;

            for (int i = 0; i < 1000; i++)
            {
                String fen = getRandomFEN();
                ArrayBoard aPos = new ArrayBoard();
                BitBoard bPos = new BitBoard();

                wa.Start();
                aPos.SetFromFEN(fen);
                wa.Stop();
                wb.Start();
                bPos.SetFromFEN(fen);
                wb.Stop();
                nbPieces += GetNbPieces(aPos);
            }
            System.Console.WriteLine("Perfs for std call of SetFenPerfs (32 pieces/board)");
            System.Console.WriteLine("ArrayBoard : " + 32 * wa.ElapsedTicks / nbPieces + " ticks/pos");
            System.Console.WriteLine("BitBoard   : " + 32 * wb.ElapsedTicks / nbPieces + " ticks/pos");
            */
        }


        public static void BenchGetLegalMovesPerfs()
        {
            /*
            Stopwatch wa = new Stopwatch();
            Stopwatch wb = new Stopwatch();
            int nbPieces = 0;

            for (int i = 0; i < 1000; i++)
            {
                String fen = getRandomFEN();
                Position p = new Position();
                p.SetFromFEN(fen);

                wa.Start();
                Engine.GetPossibleMoves(p);
                wa.Stop();
                wb.Start();
                Engine.GetLegalMoves(p);
                wb.Stop();
                nbPieces += GetNbPieces(p);
            }
            System.Console.WriteLine("Perfs for std call of GetLegalMoves (32 pieces/board)");
            System.Console.WriteLine("GetPossibleMoves : " + 32 * wa.ElapsedTicks / nbPieces + " ticks/pos  (total:" + wa.ElapsedTicks + "ticks)");
            System.Console.WriteLine("GetLegalMoves   : " + 32 * wb.ElapsedTicks / nbPieces + " ticks/pos (total:" + wb.ElapsedTicks + "ticks)");
            */
        }



        internal static void LaunchBench()
        {
            throw new NotImplementedException();
        }
    }
}
